﻿using Microsoft.Extensions.DependencyInjection;
using WH.Repositories.CodeFirst;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WH.Extensions.Setup
{

    public static class CodeFirstExtensionSetup
    {
        public static void AddCodeFirstExtensionHostedServiceSetup(this IServiceCollection services)
        {
            services.AddScoped<CodeFirstExtension>();

            var codeFirst = services.BuildServiceProvider().GetService<CodeFirstExtension>();

            codeFirst?.InitDbTablesSeedData().Wait();
        }
    }

}
